import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '发布人',
    align:"center",
    dataIndex: 'publishUser_dictText'
   },
   {
    title: '标题',
    align:"center",
    dataIndex: 'title'
   },
   {
    title: '工作描述',
    align:"center",
    dataIndex: 'msg'
   },
   {
    title: '工作福利',
    align:"center",
    dataIndex: 'benefit'
   },
   {
    title: '工作经验',
    align:"center",
    dataIndex: 'experience'
   },
   {
    title: '学历',
    align:"center",
    dataIndex: 'edu_dictText'
   },
   {
    title: '起始薪资',
    align:"center",
    dataIndex: 'salaryS'
   },
   {
    title: '结束薪资',
    align:"center",
    dataIndex: 'salaryE'
   },
   {
    title: '工作关键字',
    align:"center",
    dataIndex: 'workTag'
   },
   {
    title: '工作城市',
    align:"center",
    dataIndex: 'workCity'
   },
   {
    title: '具体地址',
    align:"center",
    dataIndex: 'address'
   },
   {
    title: '工作分类',
    align:"center",
    dataIndex: 'type_dictText'
   },
   {
    title: '状态',
    align:"center",
    dataIndex: 'status_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "发布人",
      field: 'publishUser',
      component: 'JSelectMultiple',
      componentProps:{
          dictCode:"sys_user,realname,id"
      },
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '发布人',
    field: 'publishUser',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"sys_user,realname,id"
     },
  },
  {
    label: '标题',
    field: 'title',
    component: 'Input',
  },
  {
    label: '工作描述',
    field: 'msg',
    component: 'InputTextArea',
  },
  {
    label: '工作福利',
    field: 'benefit',
    component: 'InputTextArea',
  },
  {
    label: '工作经验',
    field: 'experience',
    component: 'Input',
  },
  {
    label: '学历',
    field: 'edu',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:""
     },
  },
  {
    label: '起始薪资',
    field: 'salaryS',
    component: 'InputNumber',
  },
  {
    label: '结束薪资',
    field: 'salaryE',
    component: 'InputNumber',
  },
  {
    label: '工作关键字',
    field: 'workTag',
    component: 'Input',
  },
  {
    label: '工作城市',
    field: 'workCity',
    component: 'Input',
  },
  {
    label: '具体地址',
    field: 'address',
    component: 'InputTextArea',
  },
  {
    label: '工作分类',
    field: 'type',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"kr_type_base,name,id"
     },
  },
  {
    label: '状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"hire_status"
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  publishUser: {title: '发布人',order: 0,view: 'list', type: 'string',dictTable: "sys_user", dictCode: 'id', dictText: 'realname',},
  title: {title: '标题',order: 1,view: 'text', type: 'string',},
  msg: {title: '工作描述',order: 2,view: 'textarea', type: 'string',},
  benefit: {title: '工作福利',order: 3,view: 'textarea', type: 'string',},
  experience: {title: '工作经验',order: 4,view: 'text', type: 'string',},
  edu: {title: '学历',order: 5,view: 'list', type: 'string',dictCode: '',},
  salaryS: {title: '起始薪资',order: 6,view: 'number', type: 'number',},
  salaryE: {title: '结束薪资',order: 7,view: 'number', type: 'number',},
  workTag: {title: '工作关键字',order: 8,view: 'text', type: 'string',},
  workCity: {title: '工作城市',order: 9,view: 'text', type: 'string',},
  address: {title: '具体地址',order: 10,view: 'textarea', type: 'string',},
  type: {title: '工作分类',order: 11,view: 'list', type: 'string',dictTable: "kr_type_base", dictCode: 'id', dictText: 'name',},
  status: {title: '状态',order: 12,view: 'list', type: 'string',dictCode: 'hire_status',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}